package com.jh.concurrent.juc.condition;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author JH_Wong
 * @projectName newforward
 * @title ConditionDemo.java
 * @package com.jh.concurrent.juc
 * @description Condition 使用DEMO
 * @date 2019-05-20 11:19
 */
public class ConditionDemo {

    public static void main(String[] args) {
        Lock lock = new ReentrantLock();
        Condition condition = lock.newCondition();
        new Thread(new ConditionAwait(lock, condition)).start();
        new Thread(new ConditionSignal(lock, condition)).start();
    }
}
